<template>
	<view>
		<image v-if="width == 0 && height == 0" class="img img-auto"  :src="'/static/image/' + src" :mode="mode" />
		
		<image v-else-if="width != 0 && height == 0" class="img img-auto" :style="{ width: width + 'rpx' }" :src="'/static/image/' + src" :mode="mode" />
		<image v-else :style="{ width:width + 'rpx', height: height + 'rpx' }" class="img-auto" :src="'/static/image/' + src" />
	</view>
</template>

<script  >
export default{
	props: {
		src: {
			type: String,
			default: ''
		},
		mode: {
			type: String,
			default: 'widthFix'
		},
		width: {
			type: Number,
			default: 0
		},
		height: {
			type: Number,
			default:0
		}
	},
}


</script>
<style scoped>
.img {
	width: 100%;
	height: auto;
	display: block;
}
.img-auto {	display: block;
	margin: auto;
}
</style>
